<html>

<head>
  <title>FM 播放器 - P2P 加速版</title>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <meta http-equiv="content-language" content="zh-CN" />
  <meta http-equiv="X-UA-Compatible" content="chrome=1" />
  <meta http-equiv="pragma" content="no-cache" />
  <meta http-equiv="expires" content="0" />
  <meta name="referrer" content="never" />
  <meta name="renderer" content="webkit" />
  <meta name="msapplication-tap-highlight" content="no" />
  <meta name="HandheldFriendly" content="true" />
  <meta name="x5-page-mode" content="app" />
  <meta name="Viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
  <script type="text/javascript" src="class.min.js"></script>
  <link rel="stylesheet" href="./plug/DPlayer.min.css" type="text/css" />
  <style type="text/css">
    html,body{
      background-color:#000;
      padding: 0;
      margin: 0;
      height:100%;
      width:100%;
      color:#999;
      overflow:hidden;
      cursor:pointer;
    }

    #dplayer {
      height:100%!important;
      width:100%!important;
      margin:0 auto;
    }
  </style>
</head>

<body>
  <div id="dplayer"></div>
  <div id="stats"></div>
  <!--兼容IE浏览器-->
  <script src="./plug/polyfill.min.js"></script>
  <script language="Javascript">
    document.oncontextmenu = new Function("event.returnValue=false");
    document.onselectstart = new Function("event.returnValue=false");
  </script>
  <script src="./plug/p2p-media-loader-core.min.js"></script>
  <script src="./plug/p2p-media-loader-hlsjs.min.js"></script>
  <script type="text/javascript" src="./plug/hls.min.js"></script>
  <script type="text/javascript" src="./plug/DPlayer.min.js"></script>
  <!--<script src="https://cdn.jsdelivr.net/npm/dplayer@latest"></script>-->
  <script type="text/javascript" src="./plug/flv.min.js"></script>
  <script type="text/javascript" src="./plug/jquery.min.js"></script>
  <!--<script type="text/javascript" src="/dplayer/p2p.js"></script>-->
  <script>
    var m3u8url = _GET('url');
    var dp = new DPlayer({
      autoplay: true,
      container: document.getElementById('dplayer'),
      volume: 1.0,
      preload: 'auto',
      screenshot: true,
      theme: '#28FF28',
      video: {
        url: m3u8url,
        type: 'customHls',
        customType: {
          'customHls': function (video) {
            const engine = new p2pml.hlsjs.Engine();
            const hls = new Hls({
              liveSyncDurationCount: 7, // To have at least 7 segments in queue
              loader: engine.createLoaderClass()
            });

            p2pml.hlsjs.initHlsJsPlayer(hls);
            hls.loadSource(video.src);
            hls.attachMedia(video);
          }
        }
      },
    });
  </script>
</body>

</html>
